import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'

class Header extends Component {

  goBack = () => {
    this.props.history.goBack()
  }

  goForward = () => {
    this.props.history.goForward()
  }

  render() {
    // console.log("基本组件Header的Props:", this.props)
    return (
      <div>
        <div className="page-header">
          <h2>我是头部标签</h2>
          <button onClick={this.goBack}>回退</button>
          <button onClick={this.goForward}>前进</button>
        </div>
      </div>
    )
  }
}

export default withRouter(Header)
